﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.IO;

namespace GDISim._Input
{
    public class Xml
    {
        public static List<T> DeserializeListFromXML<T>(string filename)
        {
            XmlSerializer deserializer = new XmlSerializer(typeof(List<T>));
            TextReader textReader = new StreamReader(filename);
            List<T> time;
            time = (List<T>)deserializer.Deserialize(textReader);
            textReader.Close();

            return time;
        }
        public static T DeserializeFromXML<T>(string filename)
        {
            XmlSerializer deserializer = new XmlSerializer(typeof(T));
            TextReader textReader = new StreamReader(filename);
            T time = (T)deserializer.Deserialize(textReader);
            textReader.Close();

            return time;
        }
    }
}
